<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
class Edit extends controller {
	function info()
	{
		$data=init_vars("Home",$this);
		
		//$data['js'] .= script_import(site_url("js/nicEdit/nicEdit.js"));
		
		$data['js'] .= script_import(site_url("js/ckeditor/ckeditor.js"));
		$data['js'] .= script_import(site_url("js/ckeditor/adapters/jquery.js"));
		$data['js'] .= script_import(site_url("js/ckeditor/plugins/tableresize/plugin.js"));
		
		$data['js'].= script_import(site_url("js/edit/main.js"));
		$data['css'].= css_import(site_url("css/edit/main.css"));
		
		$this->load->model('main_model');
		$data['articles'] = $this->main_model->getArticles('info',true);
		$data['pagename'] = $this->uri->segment(2);
		$this->load->view('edit/articles',$data);
		
	}
	function getEditor($page,$article_id){
		$this->load->model('main_model');
		$data['article'] = $this->main_model->getArticle($article_id,$page);
		$this->load->view('edit/editor',$data);
	}
	
}